bar = 
foo = $(bar)

all:
ifdef foo
	echo "foo is defined"
endif 
ifndef bar 
	echo "bar is not"
endif